<?php

namespace App\Filament\Mine;

use Filament\Resources\Pages\ListRecords;
use Filament\Support\Facades\FilamentView;
use Filament\View\PanelsRenderHook;

class MineBaseList extends ListRecords
{
    public string $mineTitle = '';

    public string $mineDescription = '';

    public function boot(): void
    {
        FilamentView::registerRenderHook(
            PanelsRenderHook::CONTENT_BEFORE,
            function () {
                return view('components.resources.list-header', [
                    'title' => $this->mineTitle,
                    'description' => $this->mineDescription,
                ]);
            }
        );

        FilamentView::registerRenderHook(
            PanelsRenderHook::TOPBAR_LOGO_AFTER,
            function () {
                return view('components.resources.breadcrumb', [
                    'breadcrumbs' => $this->getBreadcrumbs(),
                ]);
            }
        );
    }

    public function getTitle(): string
    {
        return '';
    }

    // 禁用默认的子标题
    public function getSubheading(): ?string
    {
        return '';
    }
}
